///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// Core responsible for running the plugin manager and prepare other resources
///</describe>
/// <date>2019/7/25</date>
///***********************************************************************
#ifndef IMICROCORE_H
#define IMICROCORE_H

#include <functional>
#include <memory>
#include "Base/IPlugin.h"
#include "Model/IFramework.h"

#define MICRO_CORE_NAME "MicroCore"

#define MICRO_CORE_VERSION 1,0,0

#define MICRO_CORE_PLUGIN_BASE MICRO_CORE_NAME,MICRO_CORE_VERSION

#define MICRO_CORE_IS_START_ON_LOAD true

#define MICRO_CORE_IS_MAIN_SERVICE true

#define MICRO_CORE_PLUGIN MICRO_CORE_PLUGIN_BASE,MICRO_CORE_IS_START_ON_LOAD,MICRO_CORE_IS_MAIN_SERVICE

class IMicroCore :public IPlugin
{
public:
	// Virtual detructe the core
	virtual ~IMicroCore() {	}

public:
	// Is core's debug mode
	virtual bool IsDebugMode() = 0;

	// Get the plugin by name and version
	virtual IPlugin* GetPlugin(std::string strPluginName,
		int iMajorVersion,
		int iMinorVersion,
		int iModifyVersion) = 0;

	// Add Task to the micro core
	virtual bool AddTask(Task& UserTask) = 0;

	// Pause the task
	virtual void PauseTask(std::string strTaskId) = 0;

	// Resume the task
	virtual void ResumeTask(std::string strTaskId) = 0;

	// Stop the task
	virtual void StopTask(std::string strTaskId) = 0;
};

#endif //IMICROCORE_H
